#pragma once
#include "Object.h"
#include "Sprite.h"
#include "windows.h"
#include "QuadTree.h"
#include "CScreen.h"
#include "Sound.h"
#include <math.h>

#define  WEAPON_NORMAL_SPEED 0.2
#define  WEAPON_HIGH_SPEED 0.4
#define  DELTA_TIME 1000/60
enum Direction{Letf=-1,Right=1};

class CWeapon: public Object
{
	static LPDIRECT3DTEXTURE9 _weaponImage;
protected:float		vY;//Van toc theo phuong OY
		  DWORD		lastTime;
		  bool		isShoot;
public:
	Direction		_direction;//Huong dang di chuyen
	bool			_justMove;//Kiem tra co di chuyen hay ko
	CScreen*		_screen;//Camera
	QuadTree*		_quadTree;//Cay tu phan de xet va cham
	static void InitResoure(){_weaponImage=CSprites::LoadTexture("Images\\Weapon.png",0);}
	CWeapon(void)
	{
		_pRect=new RECT();
		_pSprite=NULL;
	}
	void SetVX(float vy){vY=vy;}
	CWeapon(int left,int top,CScreen *sc,QuadTree *q,int kind,CSound *sManager);
	void Update(int leftRect,int Style);//Update lai sau moi frame
	/*int Move();//Di chuyen 
	void Collision(Object *Ob);//xet va cham
	~CWeapon(void);
	void Release(){}
	int CheckLeftRight();//kiem tra truoc khi di chuyen
	int CheckUpDown(bool IsUp);//kiem tra tren duoi
	void Die();//hieu ung khi chet
	void ChangeStatus(int style);//Thay doi trang thai	*/
};